%h1 
  Site Management for 
  = @contest_name

= content_tag(:div,flash[:notice],:class => "notice") if flash[:notice]!=nil 

.login-bigbox
  .title For Country Administrator.
  %small
    &nbsp;&nbsp;&nbsp;
    To add sites, view contestant list, 
    and manage contestants' id's (when you have many sites).
    %br/
  %br/
  Please login.
  .login-box
    - form_for :country, nil, :url => {:action => 'country_login'} do |f|
      Country:
      = select :country, :id, @country_select
      Password:
      = f.password_field :password
      = submit_tag "Country Administrator Login"

%br/

%script{:type => 'text/javascript'}
  var siteList = new Array();
  - @countries.each do |country|
    = "siteList[#{country.id}] = new Array();"
    - country.sites.each do |site| 
      = "siteList[#{country.id}][#{site.id}] = \"#{site.name}\";"

  var allSiteList = new Array();
  - @site_select.each do |sel|
    = "allSiteList[#{sel[1]}]=\"#{sel[0]}\";"

%script{:type => 'text/javascript', :src => '/javascripts/site_update.js'}

.login-bigbox
  .title For Site Administrator.
  %small
    &nbsp;&nbsp;&nbsp;
    To add contestants to your site.
    Please ask your country administrator for password.
    %br/
  %br/
  Please select your country and site and login.
  .login-box
    - form_for :login, nil, :url => {:action => 'site_login'} do |f|
      Country:
      = select :site_country, :id, @country_select_with_all, {}, {:onchange => "updateSiteList();", :onclick => "updateSiteList();" }
      Site: 
      = select :login, :site_id, @site_select
      %br/
      Password:
      = f.password_field :password
      = submit_tag "Site Administrator Login"

%script{:type => 'text/javascript'}
  updateSiteList();
